package ec.edu.cec.java.adv.archivos;

import java.io.File;

public class FileIsExecute {
   public static void main(String[] args) {
      
      File f = null;
      String[] strs = {"c:\\test\\test1.txt", "c:\\test\\test2.txt", "c:\\test\\test3.magx" };
      try{
         // for each string in string array 
         for(String s: strs ){
            // create new file
            f= new File(s);
            // Pregunta si el archivo practimente existe!!!
            // true if the file is executable
            boolean bool = f.canExecute();
            // find the absolute path
            String a = f.getAbsolutePath();
            
            System.out.println(a + " is executable: "+ bool);

         } 
      }catch(Exception e){
         // if any I/O error occurs
         e.printStackTrace();
      }
   }
}